/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.ekuma.epos.bean.util;

import com.openbravo.format.Formats;
import com.openbravo.bean.InventoryLine;
import com.openbravo.pos.util.StringUtils;

/**
 *
 * @author Administrator
 */
public class InventoryLineHelper {

    public static String printName(InventoryLine l) {
        return StringUtils.encodeXML(l.getProductName());
    }

    public static String printPrice(InventoryLine l) {
        if (l.getMultiply() == 1.0) {
            return "";
        } else {
            return Formats.CURRENCY.formatValue(new Double(l.getPrice()));
        }
    }

    public static String printMultiply(InventoryLine l) {
        return Formats.DOUBLE.formatValue(new Double(l.getMultiply()));
    }

    public static String printSubValue(InventoryLine l) {
        return Formats.CURRENCY.formatValue(new Double(l.getSubValue()));
    }
}
